<?php

class m_form_actions_block_ShowRecordAction extends m_backoffice_extends_Form
{
	public function execute()
	{
        $record = $this->getRequestDocument();
        /* @var $record m_form_documents_Record */

        if(is_null($this->getRequestParameter('noStatus')))
        {
            $record->setPublicationstatus('READ')->save();
        }

        $structure = $this->getDocumentProvider()->getByUniqueId($record->getStructureId(), $record->getLang());

        $this->addToModel('record', $record);
        $this->addToModel('structure', $structure);
		$this->setView('success');
	}	
}